﻿using Adnc.Infra.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace WYT.Pro.Repository.Entites
{
    /// <summary>
    /// 商品规格
    /// </summary>
    [Table("pro_Size"), Comment("商品规格"),Index(nameof(GoodsID))]
    [Serializable]
    public class GoodsSize : EfEntity
    {
        /// <summary>
        /// 商品ID
        /// </summary>
        [Comment("商品ID")]
        public long GoodsID { get; set; }

        /// <summary>
        /// 是否是商品的默认规格
        /// </summary>
        [Comment("是否是商品的默认规格")]
        public bool IsDefalut { get; set; }

        /// <summary>
        /// ERP编码
        /// </summary>
        [MaxLength(50), Comment("ERP编码")]
        public string? ERPCode { get;set; }

        /// <summary>
        /// 规格名称
        /// </summary>
        [MaxLength(100), Comment("规格名称")]
        public string Name { get; set; }

        /// <summary>
        /// 规格名称(维语)
        /// </summary>
        [MaxLength(200), Comment("规格名称(维语)")]
        public string UighurName { get; set; }

        /// <summary>
        /// 缩率图
        /// </summary>
        [MaxLength(2000), Comment("缩率图")]
        public string Thumbnail { get; set; }

        /// <summary>
        /// 业绩价格
        /// </summary>
        [Comment("业绩价格"), Column(TypeName = "decimal(18,2)")]
        public decimal PerformancePrice { get; set; }

        /// <summary>
        /// 成本价格
        /// </summary>
        [Comment("成本价格"), Column(TypeName = "decimal(18,2)")]
        public decimal CostPrice { get; set; }

        /// <summary>
        /// 原价
        /// </summary>
        [Comment("原价"), Column(TypeName = "decimal(18,2)")]
        public decimal Price { get; set; }

        /// <summary>
        /// 单量
        /// </summary>
        [Comment("单量")]
        public int ProxyIntegral { get; set; }

        /// <summary>
        /// 购物积分
        /// </summary>
        [Comment("购物积分")]
        public int ShoppingIntegral { get; set; }

        /// <summary>
        /// 第三方商品返佣
        /// </summary>
        [Comment("第三方商品返佣"), Column(TypeName = "decimal(18,2)")]
        public decimal ThirdCommission { get; set; } = 0;

        /// <summary>
        /// 库存
        /// </summary>
        [Comment("库存")]
        public int Inventory { get; set; }

        /// <summary>
        /// 状态（-1：删除；0：正常）
        /// </summary>
        [Comment("状态（-1：删除；0：正常）")]
        public int State { get; set; }

        /// <summary>
        /// 对应云仓商品ID
        /// </summary>
        [Comment("对应云仓商品")]
        public long? WarGoods { get; set; }

        /// <summary>
        /// 对应云仓规格ID，仅对直营商品有效
        /// </summary>
        [Comment("对应云仓规格ID")]
        public long? WarSize { get; set; }

        /// <summary>
        /// 对应云仓规格商品数量，仅对直营商品有效
        /// </summary>
        [Comment("对应云仓规格商品数量，仅对直营商品有效")]
        public int? WarCount { get; set; }
    }
}
